String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}

// String.format 
function _StringFormatInline(){
    var txt = this;
    for (var i = 0; i < arguments.length; i++) {
        var exp = new RegExp('\\{' + (i) + '\\}', 'gm');
        //txt = txt.replace(exp, arguments[i].replace(/((\%3C)|<)((\%2F)|\/)*[a-z0-9\%]+((\%3E)|>)/ig,''));
        txt = txt.replace(exp, arguments[i]);
    }
    return txt;
}

function _StringFormatStatic(){
    for (var i = 1; i < arguments.length; i++) {
        var exp = new RegExp('\\{' + (i - 1) + '\\}', 'gm');
        //arguments[0] = arguments[0].replace(exp, arguments[i].replace(/((\%3C)|<)((\%2F)|\/)*[a-z0-9\%]+((\%3E)|>)/ig,''));
        arguments[0] = arguments[0].replace(exp, arguments[i]);
    }
    return arguments[0];
}

if (!String.prototype.format) {
    String.prototype.format = _StringFormatInline;
}

if (!String.format) {
    String.format = _StringFormatStatic;
}

// "select team", "ESP"
function trackEvent(strIdEvent, strIdText){
    try {
			strIdText = strIdText.split(" v ").join(" - ");
			strIdText = strIdText.split(" vs ").join(" - ");
			strIdText = strIdText.split(" x ").join(" - ");		 
        	_gaq.push(['_trackEvent', strIdEvent, strIdText]);
    } 
    catch (e) {
    
    }
}
